package com.gxc.service.user.controller;

import com.gxc.service.user.entity.UserEntity;
import com.gxc.service.user.repository.UserRepository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author GongXincheng
 * @since 2019-11-11 14:08
 */
@RestController
@RequestMapping("/auth")
public class AuthController {

    @Resource
    private UserRepository userRepository;

    @GetMapping("/user/{username}")
    public UserEntity findByUsername(@PathVariable String username) {
        return userRepository.findByUsername(username);
    }

}
